package com.example.ucs_alg_node_manager.controller;

import com.example.ucs_alg_node_manager.dto.LoginDTO;
import com.example.ucs_alg_node_manager.service.UserService;
import com.example.ucs_alg_node_manager.vo.ReturnVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
@CrossOrigin
@Api("用户功能管理")
public class UserController {

    @Resource
    private UserService userService;

    @ApiOperation("用户登录接口")
    @PostMapping("/login")
    public ReturnVO login(@RequestBody LoginDTO loginDTO){
        return userService.login(loginDTO);
    }

    @ApiOperation("邮箱实现密码重置")
    @GetMapping("/reset")
    public ReturnVO resetPasswd(@RequestParam("email")String email){
        return userService.reset(email);
    }


}
